<template>
  <div class="container">
    <span class="on" id="music"></span>
    <canvas id="bg" height="600"></canvas>
    <canvas id="firework" height="600"></canvas>
    <canvas id="fall" height="600"></canvas>
    <div id="loading">loading ...</div>
    <message v-if="isShow"></message>
  </div>
</template>

<script>
import index from "./files/js/index.js";
import message from "../../components/modal";

export default {
  components: {
    message
  },
  data() {
    return {
      isShow: false
    };
  },
  mounted() {
    document.title = "情侣乐";
    const timer = setTimeout(() => {
      this.isShow = true;
    }, 110000);
    index();
  }
};
</script>

<style lang="scss" scope="scoped">
.container {
  width: 100%;
  height: 100%;
}
canvas {
  height: 100vh;
  width: 100vw;
  position: absolute;
  left: 0;
  top: 0;
}
#bg {
  z-index: 5;
  background: url(../../img/fire-bg.png) center no-repeat;
  background-size: cover;
}
#firework {
  z-index: 8;
}
#title {
  z-index: 9;
}
#fall {
  z-index: 10;
}
#dialogue {
  z-index: 11;
}
#loading {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 999;
}
.title {
  z-index: 9;
}
#music {
  width: 36px;
  height: 36px;
  background-repeat: no-repeat;
  background-size: 100%;
  position: absolute;
  right: 10px;
  top: 14px;
}
@-webkit-keyframes play {
  0% {
    transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
  }
}
.on {
  background-image: url("./files/img/musicon.png");
  -webkit-animation: play 1.5s linear both infinite;
}
.off {
  background-image: url("./files/img/musicoff.png");
}
</style>

